Kanzi 3.6.6 migration guide
Use this migration guide to update Kanzi applications from Kanzi 3.6.4 and 3.6.5 to Kanzi 3.6.6.
Migrating Kanzi 3.6.4 and 3.6.5 applications to use the Android platform package
The Android platform package does not support the V8 library. Before you migrate your Kanzi application, disable or remove JavaScript from the Kanzi application that you want to migrate.
To migrate Kanzi 3.6.4 and 3.6.5 applications to use the Android platform package:
- Install the Android platform package. See Installing the Android platform package.
- Copy the <KanziWorkspace>/Engine/applications/kzb_player/configs/platforms/android_gradle directory to the <ProjectName>/Application/configs/platforms directory of the Kanzi application that you want to migrate to the new Android platform package.
- In your Kanzi application, edit the Java resources:
- In the android_gradle/app/src/main/java/com/rightware/kanzi/kzbplayer directory rename the KZBPlayer.java file to the name of your application.
For example, if your project is called MyProject, rename the KZBPlayer.java file to MyProject.java. - In the android_gradle/app/src/main/java/com/rightware/kanzi directory rename the kzbplayer directory to the lowercase name of your application.
For example, if your application is called MyProject, rename the kzbplayer directory to myproject. -
In a text editor open the <project_name>.java file and edit the file to include the references to your application.
For example, if your application is called MyProject:- Change
com.rightware.kanzi.kzbplayer
to
com.rightware.kanzi.myproject
- Change the class
KZBPlayer
to
MyProject - Change the
TAG
"KZBPlayer"
to
"MyProject" - Change
Debug.startMethodTracing("kzbplayer")
to
Debug.startMethodTracing("myproject")
- In a text editor open the android_gradle/app/src/main/AndroidManifest.xml file and edit the file to include the references to your application.
For example, if your application is called MyProject:- Change
com.rightware.kanzi.kzbplayer
to
com.rightware.kanzi.myproject - Change
activity android:name=".KZBPlayer"
to
activity android:name=".MyProject"
- In a text editor open the android_gradle/app/src/main/res/values/strings.xml file and edit the file to include the name of your application.
For example, if your application is called MyProject, change
<string name="app_name">KZB Player</string>
to
<string name="app_name">MyProject</string>
- In your project, edit the build scripts:
- In a text editor open the android_gradle/app/CMakeLists.txt file and edit the file to include the name of your application and the path to the C++ application source file.
For example, if your application is called MyProject:- Change
project(kzb_player)
to
project(myproject) - Change
add_executable(${PROJECT_NAME} src/main/cpp/kzb_player.cpp)
to
add_executable(${PROJECT_NAME} ../../../../src/myproject.cpp)
- In a text editor open the android_gradle/settings.gradle file and edit the file to include the name of your application.
For example, if your application is called MyProject, set the value of the rootProject.name to "myproject". - In a text editor open the android_gradle/app/build.gradle file and edit the file so that
applicationId points to you application.
For example, if your application is called MyProject, set the applicationId to "com.rightware.kanzi.myproject".
- In your application, edit the C++ source files:
- In the Application/src/<project_name>.cpp file change:
class <ProjectName>: public ExampleApplication
to
class <ProjectName>: public Application
- In the <project_name>.cpp file add a
registerMetadataOverride callback that does not contain V8Module registration:class <ProjectName>: public Application
{
public:
...
virtual void registerMetadataOverride(ObjectFactory& /*factory*/) KZ_OVERRIDE
{
Domain* domain = getDomain();
KanziComponentsModule::registerModule(domain);
}
}; - In the <project_name>.cpp file in the
onConfigure callback function remove references to the ExampleApplication class: virtual void onConfigure(ApplicationProperties& configuration) KZ_OVERRIDE
{
Application::onConfigure(configuration);
configuration.binaryName = "<project_name>.kzb.cfg";
configuration.extensionOutputEnabled = true;
configuration.defaultSurfaceProperties.antiAliasing = 0;
configuration.defaultSurfaceProperties.bitsDepthBuffer = 0;
configuration.defaultSurfaceProperties.bitsStencil = 0;
}
- Build and deploy your Kanzi application using either Android Studio or the command line interface. See Building and deploying Kanzi applications from Android Studio and Building and deploying Kanzi applications from the command line.
See also
Kanzi 3.6.6 release notes
Known issues
Open topic with navigation